package com.funo.wcity.app.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.funo.wcity.app.entity.Tblemployees;

@Repository("tblemployeesDAO")
public class TblemployeesDAO extends DefaultBaseDao<Tblemployees,Integer>{
    
	/**
	 * 查询员工的所有id
	 */
	public String getTblemployeesId(String idEmployees){
		String sql="select idEmployee from  tblEmployeeEmployees t where t.idParentEmployee in("+idEmployees+")";
		List list=this.jdbcTemplate.queryForList(sql);
		if(list.size()>0){
			StringBuffer sb=new StringBuffer();
			for(int i=0;i<list.size();i++){
				Map map=(Map)list.get(i);
				sb.append(map.get("IDEMPLOYEE")).append(",");
			}
			return sb.length()>0?sb.substring(0, sb.length()-1):"";
		}else{
			return null;
		}
	}
}
